package home

import (
	"github.com/gin-gonic/gin"

	"github.com/zeromicro/go-zero/tools/goctl/example/api/internal/svc"
)

type Ai struct {
	svcCtx *svc.ServiceContext
}

func NewAi(svcCtx *svc.ServiceContext) *Ai {
	return &Ai{
		svcCtx: svcCtx,
	}
}

func (h *Ai) InitRegister(engine *gin.Engine) {
	g := engine.Group("v1/ai")
	g.POST("/chat", h.Chat)
	g.POST("/amsap", h.Amsap)
	g.POST("/contentplangen", h.ContentPlanGen)
}

// 根据用户需求处理AI任务
func (h *Ai) Chat(ctx *gin.Context) {
	var req domain.AIChatReq
	if err := httpx.BindAndValidate(ctx, &req); err != nil {
		httpx.FailWithErr(ctx, err)
		return
	}
	_ = req
}

// 确认AI业务请求中的具体业务
func (h *Ai) Amsap(ctx *gin.Context) {
	var req domain.AIAmsapReq
	if err := httpx.BindAndValidate(ctx, &req); err != nil {
		httpx.FailWithErr(ctx, err)
		return
	}
	_ = req
}

// 生成内容计划
func (h *Ai) ContentPlanGen(ctx *gin.Context) {
	var req domain.AIContentPlanGenReq
	if err := httpx.BindAndValidate(ctx, &req); err != nil {
		httpx.FailWithErr(ctx, err)
		return
	}
	_ = req
}
